const a = [101, 42, 23, 4, 5, 6, 4, 5, 6, 11, 23, 42, 56, 78, 100]

function dispatchToThree(a) {
    let res = [{sum: 0, arr: []}, {sum: 0, arr: []}, {sum: 0, arr: []}]
    let newA = a.slice().sort((a,b) => b - a)
    newA.forEach((item) => {
        //? 拿到三份中的最小
        let min = res.sort((a, b) => a.sum - b.sum)[0]
        min.arr.push(item)
        min.sum += item
    })
    return res
}

console.log(dispatchToThree(a))
